<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Yaf_View_Interface class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="yaf-action-abstract.getcontroller.html">Yaf_Action_Abstract::getController</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="yaf-view-interface.assign.html">Yaf_View_Interface::assign</a></div>
 <div class="up"><a href="book.yaf.html">Yaf</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.yaf-view-interface" class="reference">

 <h1 class="title">The Yaf_View_Interface class</h1>
 

 <div class="partintro"><p class="verinfo">(Yaf &gt;=1.0.0)</p>


  <div class="section" id="yaf-view-interface.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    Yaf给用户提供一个了一个可扩展的、可自定的视图引擎接口，用户可以使用自己的视图引擎来代替Yaf内置的<a href="class.yaf-view-simple.html" class="classname">Yaf_View_Simple</a>。下面是一个关于怎么实现的例子，请看<span class="methodname"><a href="yaf-dispatcher.setview.html" class="methodname">Yaf_Dispatcher::setView()</a></span>。
   </p>
  </div>


  <div class="section" id="yaf-view-interface.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Yaf_View_Interface</strong>
     </span>
     {</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="yaf-view-interface.assign.html" class="methodname">assign</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="yaf-view-interface.display.html" class="methodname">display</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$tpl</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$tpl_vars</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="yaf-view-interface.getscriptpath.html" class="methodname">getScriptPath</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="yaf-view-interface.render.html" class="methodname">render</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$tpl</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$tpl_vars</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="yaf-view-interface.setscriptpath.html" class="methodname">setScriptPath</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$template_dir</code></span>
   )</div>

   }</div>


  </div>

 </div>

 




































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="yaf-view-interface.assign.html">Yaf_View_Interface::assign</a> — 为视图引擎分配一个模板变量</li><li><a href="yaf-view-interface.display.html">Yaf_View_Interface::display</a> — 渲染一个视图模板, 并直接输出给请求端</li><li><a href="yaf-view-interface.getscriptpath.html">Yaf_View_Interface::getScriptPath</a> — The getScriptPath purpose</li><li><a href="yaf-view-interface.render.html">Yaf_View_Interface::render</a> — 渲染一个视图模板</li><li><a href="yaf-view-interface.setscriptpath.html">Yaf_View_Interface::setScriptPath</a> — The setScriptPath purpose</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="yaf-action-abstract.getcontroller.html">Yaf_Action_Abstract::getController</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="yaf-view-interface.assign.html">Yaf_View_Interface::assign</a></div>
 <div class="up"><a href="book.yaf.html">Yaf</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
